<template>
	<view>
		<web-view :src="url" @message="msg"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				token:'',
				url:''
			};
		},
		onLoad(options) {
			let token = uni.getStorageSync('token')
			
			let url = options.url
			let http = 'https://0510yanglao.62.hzgqapp.com/h5/#/'
			// console.log(Object.keys(options),'---');
			
			if(Object.keys(options).length>=1){
				let str = '?'
				Object.keys(options).forEach(e=>{
					if(e!='url'){
						str += e+'='+options[e]+'&'
					}
				})
				this.url = http+url+str+'token='+token
			}else{
				this.url = http+url+'?token='+token
			}
			console.log(this.url);
		},
		methods:{
			msg(data){
				console.log(data,'=--')
			}
		}
	}
</script>

<style lang="scss">

</style>
